<?php

if (!defined('BASEPATH'))
	exit('No direct script access allowed');

/**
 * UME Form Validation Class
 *
 * @package		CodeIgniter
 * @subpackage	Libraries
 * @category	Validation
 * @author		KITS Team
 */
class PNC_Form_validation extends CI_Form_validation {

	/**
	 * Uppercase alpha numeric
	 *
	 * @access	public
	 * @param	string
	 * @return	bool
	 */
	public function upper_alpha_numeric($str) {
		return (!preg_match("/^((STAFF_)+[0-9]{3,})+$/i", $str)) ? FALSE : TRUE;
	}

	/**
	 * Uppercase alpha
	 *
	 * @access	public
	 * @param	string
	 * @return	bool
	 */
	public function upper_alpha($str) {
		return (!preg_match("/^([A-Z])+$/i", $str)) ? FALSE : TRUE;
	}

	/**
	 *    Method is used to validate strings to allow alpha
	 *    numeric spaces underscores and dashes ONLY.
	 *    @param $str_in    String    The item to be validated.
	 *    @return BOOLEAN   True if passed validation false if otherwise.
	 */
	public function alpha_num_dash_space($str) {
		return (!preg_match("/^([A-Za-z0-9_ ])+$/i", $str)) ? FALSE : TRUE;
	}

	/**
	 *    Method is used to validate strings to allow alpha
	 *    numeric spaces underscores and dashes ONLY.
	 *    @param $str    String    The item to be validated.
	 *    @return BOOLEAN   True if passed validation false if otherwise.
	 */
	public function alpha_string($str) {
		return (!preg_match("/^([A-Za-z0-9_ ,.?!@()+''\"\";])+$/i", $str)) ? FALSE : TRUE;
	}

}

/* End of file PNC_Form_validation.php */
/* Location: ./application/libraries/PNC_Form_validation.php */